const fs = require('fs');
const path = require('path');

// 导入swaggerDef.js
const swaggerDef = require('../swaggerDef.js');

// 转换为JSON格式
const swaggerJson = JSON.stringify(swaggerDef, null, 2);

// 写入swagger.json文件
fs.writeFileSync(path.join(__dirname, '../swagger.json'), swaggerJson);

console.log('Swagger JSON file generated successfully!'); 